<?php
namespace app\home\validate;

use think\Validate;

class GoodsCheck extends Validate
{
    protected $rule = [
        'name' => 'require',
        'warehouse' => 'require',
        'version' => 'require',
        'unit' => 'require',
        'num' => 'require',
        'price' => 'require',
        'id' => 'require',
    ];

    protected $message = [
        'name.require' => '名称不能为空',
        'warehouse.require' => '缺少仓库',
        'version.require' => '缺少规格型号',
        'unit.require' => '缺少单位',
        'num.require' => '缺少数量',
        'price.require' => '缺少单价',
        'id.require' => '缺少更新条件',
    ];

    protected $scene = [
        'add' => ['name','warehouse','version','unit','num','price','money'],
        'edit' => ['id','name','warehouse','version','unit','num','price','money'],
    ];
}
